#pragma once
#include "LevelElement.h"
class PhysX;
class NxActor;

class CubePhysX : public LevelElement
{
public:
	CubePhysX(PhysX* physx,float width=1.0f, float height=1.0f, float depth=1.0f, D3DXCOLOR color=D3DXCOLOR(1,1,1,1),int bodyType=RIGID);
	virtual ~CubePhysX(void);
	/**
	* RIGID: dynamic physics body, STATIC: fixed body, GHOST: no physics
	*/
	static const int RIGID,STATIC,GHOST;
	/**
	* Set the body as rigid body or as static body(fixed)
	*/
	virtual void SetBodyType(int bodyType);
	
	/*************************************************************************
	* implement this in derived class to initalize
	*/
	virtual void Initialize(ContentManager *pContentManager){};
	/*************************************************************************
	* Implement this method in derived class 
	*/
	virtual void Tick(const InputState & refInputState);
	/*************************************************************************
	* Implement this method to Draw the D3DObject in the scene.
	* @param RenderContext to use.
	*/
	virtual void Draw(const RenderContext* pRenderContext){}

	/**
	* Add a force to the physics object
	*/
	void AddForce(const D3DXVECTOR3& pos);
	/**
	*	Creates a physics entity for the visble object
	*/
	virtual void InitActor(){}
	virtual NxActor* GetActor(){return m_pActor;};
	virtual void Translate(const D3DXVECTOR3 pos);
protected:
	/**
	*	Creates a physics entity for the visble object
	*/
	virtual void InitActor(int bodytype);
	/**
	* The physics representation of an object
	*/
	NxActor *m_pActor;
	PhysX* m_pPhysX;
	/**
	* The dimensions of the cube.
	*/
	float m_Width,m_Height,m_Depth;
private:
	// -------------------------
	// Disabling default copy constructor and default assignment operator.
	// If you get a linker error from one of these functions, your class is internally trying to use them. This is
	// an error in your class, these declarations are deliberately made without implementation because they should never be used.
	// -------------------------
	CubePhysX(const CubePhysX& t);
	CubePhysX& operator=(const CubePhysX& t);
};
